package com.dt76.smallloanbackendservice.controller.afterloan;

import com.dt76.smallloanbackendservice.pojo.afterloan.SettlementCommitInfo;
import com.dt76.smallloanbackendservice.pojo.afterloan.SettlementQualification;
import com.dt76.smallloanbackendservice.service.afterloan.SettlementService;
import com.dt76.smallloanbackendservice.utils.PageResult;
import org.springframework.web.bind.annotation.*;

@RestController
public class SettlementController {

    private final SettlementService settlementService;

    public SettlementController(SettlementService settlementService) {
        this.settlementService = settlementService;
    }

    @PostMapping("/loanSettlement/getPageAll")
    public PageResult getPageAll(@RequestBody SettlementQualification q, Integer page, Integer size) {
        return settlementService.getPageList(page, size, q);
    }

    @PostMapping("/loanSettlement/getCommitInfo")
    public Integer getCommitInfo(@RequestBody SettlementCommitInfo q, Integer loanId) {
        return settlementService.modifyCommit(loanId, q);
    }
}
